#include <stdio.h>
#include"mpconfigport.h"
#include "wm_hal.h"
#include "FreeRTOS.h"
#include "task.h"

PRIVILEGED_DATA uint8_t ucHeap[configTOTAL_HEAP_SIZE];

const HeapRegion_t xHeapRegions[] = 
{ 
    {(uint8_t*)ucHeap, configTOTAL_HEAP_SIZE},
#if MICROPY_HW_EN_PSRAM && MICROPY_HW_PSRAM_SIZE
    {{ uint8_t*}0x30000000UL, MICROPY_HW_PSRAM_SIZE},
#endif
    { NULL, 0 }/*终止数组 */ 
};

extern void mpy_task(void *args);

int main(int argc, char* argv[])
{
    SystemClock_Config(CPU_CLK_240M);
    vPortDefineHeapRegions(xHeapRegions);
    
    xTaskCreate(mpy_task, "mpy_task", 2560, NULL, 35, NULL);  // stack: 2560*sizeof(uint32_t)=10KB
    vTaskStartScheduler();
    return 0;
}